package com.example.view;

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        for(int i = 0; i < 30; i++){
            list.add(i);
        }
        List<Integer> subList = list.subList(10, 20);
        System.out.println(subList);

//      非结构性更改可以影响到原来的list
        subList.set(1, 100);
//      结构型更改不能影响到原来的list
        subList.clear();
        System.out.println(subList);

        System.out.println(list);
    }
}
